From: Benjamin Berg Date: Wed, 27 Nov 2019 15:35:45 +0000 (+0100) Subject: util: Place spawned processes into a systemd scope X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~317 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4a6c2f1fe65debc79451ee123b73c5e5597e6b6d;p=gnome-shell.git util: Place spawned processes into a systemd scope This improves the separation from the shell for applications launched with Alt+F2 and in a few other cases. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/863 --- diff --git a/js/misc/util.js b/js/misc/util.js index b2c46a79a..f143c9151 100644 --- a/js/misc/util.js +++ b/js/misc/util.js @@ -3,7 +3,7 @@ formatTime, formatTimeSpan, createTimeLabel, insertSorted, makeCloseButton, ensureActorVisibleInScrollView, wiggle */ -const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi; +const { Clutter, Gio, GLib, GObject, Shell, St, GnomeDesktop } = imports.gi; const Gettext = imports.gettext; const Main = imports.ui.main; @@ -126,6 +126,10 @@ function trySpawn(argv) { throw err; } } + + // Async call, we don't need the reply though + GnomeDesktop.start_systemd_scope(argv[0], pid, null, null, null, () => {}); + // Dummy child watch; we don't want to double-fork internally // because then we lose the parent-child relationship, which // can break polkit. See https://bugzilla.redhat.com//show_bug.cgi?id=819275